***********************************************************************************
********"Macroprudential Regulation, Quantitative Easing, and Bank Lending"********
***********************************************************************************
* This file sets up the datasets that will be 
* used for the 2019, 2015 and general monetary policy analyses.
***********************************************************************************
***********************************************************************************


*==================================================================================
**# Bookmark (input)
clear *
import sas using $inputdirectory/assets, case(lower)

rename dat time
tostring(time), replace
gen xxx=date(time, "YMD")
rename time oldtime
gen time=mofd(xxx)
drop xxx
format time %tm

format assets %20.0g
rename ente_segn bankid
drop oldtime
xtset bankid time

**# Bookmark (saving dataset - total assets)
compress
save $inputdirectory/INB_assetsi, replace


*==================================================================================
**# Bookmark (input)
clear *
import sas using $inputdirectory/depo, case(lower)

rename dat date
tostring(date), replace
gen xxx=date(date, "YMD")
drop date
gen time = mofd(xxx)
drop xxx
format time %tm

rename ente_segn bankid
rename importo depo
format depo %20.0g

**# Bookmark (saving dataset - customer deposits)
compress
save $inputdirectory/INB_depo, replace
